package com.example.zhuopeng.graduateddesign.util;

import com.example.zhuopeng.graduateddesign.entity.InputPromptJson;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhuopeng on 2018/4/8.
 */

public class InputPromptJsonAnalysis {

    public static List<String> AnalysisForName(JSONObject jsonObject) throws JSONException {
        JSONArray tips = jsonObject.getJSONArray("tips");
        List<String> nameArray = new ArrayList<String>();
        for(int i = 0 ; i < tips.length(); i++){
            JSONObject tip = tips.getJSONObject(i);
            String name = tip.getString("name");
            nameArray.add(name);
        }
        return nameArray;
    }



}
